
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="bootstrap/js/bootstrap.js"></script>
    <script src="bootstrap/js/bootstrap.bundle.js"></script>
    <script src="jquery/jquery-3.4.1.js"></script>
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/style.css" />
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
	<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<!--头部导航栏 start-->
<ul class="nav bgcolor">
			<li class="nav-item menu1">
				<a class="nav-link active" href="#">优菈博客</a>
			</li>
			<li class="nav-item ">
				<a class="nav-link menu2" href="#">首页</a>
			</li>
			<li class="nav-item">
				<a class="nav-link menu2" href="#">简介</a>
			</li>
			<li class="nav-item">
				<a class="nav-link menu2" href="#">详情</a>
			</li>
			<li class="nav-item">
				<a class="nav-link menu2" href="#">后台管理</a>
			</li>
			

</ul>
<!--头部导航栏end-->

<div class="container-fluid">
	<div class="row">
		<img  src="img/topbg.jpg" width="100%" height="100%" />
	</div>
</div>


 <div class="container">
  	<!--评论区板块start-->
  	<div class="row justify-content-md-center">
  		<div class="col-lg">
  			<form  action="message.class.php" method="post">
  				<div class="form-group">
    				<label for="exampleFormControlTextarea1">评论区：</label>
    				<label class="offset-9">共<?php echo countmessage();?>条评论</label>
    				<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="textline"></textarea>
  				</div>
  				<input type="reset" value="重置" class="btn btn-primary mb-3 offset-9"/>
  				<button type="submit" class="btn btn-primary mb-3 offset-1" >发布评论</button>
			</form>	
  		</div>
  	</div>
  	<!--评论区板块end-->
  	
  	<!--显示评论区发言start-->
  	<div class="row justify-content-md-center">
  		<div class="col-lg">
  			<div style="border-bottom:2px solid #CCC"><span>全部评论</span></div>
  			
  		</div>
  	</div>
  	<!--显示评论区发言end-->
 
 
 
  	<div class="row justify-content-md-center">
  		<div class="col-lg">
  			<?php for($i=$start_index;$i<=$end_index;++$i): 
  				$countnum=$count->fetch_assoc();?>
              <div class="media">
  				<img src="img/u=741809016,3018979763&fm=11&gp=0.jpg" class="mr-3" alt="..." width="60px" height="60px">
  				<div class="media-body">
    			<h5 class="mt-0"><?php echo $countnum["username"].'&nbsp&nbsp&nbsp&nbsp'.$countnum["date"];?></h5>
    			
    			<p> <?php  echo $countnum["message"]?></p>
  				</div>
			</div>
			<?php endfor?>
  		</div>

        
  		
  	</div>
  	
  	
  	<div class="row justify-content-md-center">
  			<div class="col-lg-4"><?php
  			function showPage($page,$total_page){
				$html ='<a href="?page=1">【首页】</a>';
				$pre_page = $page-1<=0?$page:($page-1);
				$html .='<a href="?page='.$pre_page.'">【上一页】</a>';
				$next_page = $page+1>$total_page?$page:($page+1);
				$html .='<a href="?page='.$next_page.'">【下一页】</a>';
				$html .='<a href="?page='.$total_page.'">【尾页】</a>';
				return $html;}	
  			echo showPage($page,$total_page);?>
  			</div>
  	</div>
  	
</div>
  	
</body>
</html>